package com.amkai.aes.webservice.binary.objecthandler.formengine;

import java.io.Serializable;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.amkai.aes.aescommon.service.formengine.FormEngineJob;
import com.amkai.aes.aescommon.service.formengine.FormEngineResult;
import com.amkai.aes.server.formengine.FormEngineProvider;
import com.amkai.aes.webservice.binary.JobObjectHandler;

public class FormEngineHandler implements JobObjectHandler<FormEngineJob, Serializable, FormEngineResult> {
	private static final Log logger = LogFactory.getLog(FormEngineHandler.class);
			
	@Override
	public FormEngineResult process(FormEngineJob job, Serializable object) throws Exception {
		FormEngineProvider em = new FormEngineProvider();
		try {
			return em.processJob(job, object);
		} catch (Throwable e) {
			logger.error("EcmManagerHandler: ", e);
			throw new Exception(e);
		}
	}

}
